package com.usian.behavior.controller;

import com.usian.behavior.service.ApBehaviorEntryService;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/behavior_entry")
public class ApBehaviorEntryController {

    @Autowired
    private ApBehaviorEntryService behaviorEntryService;

    @GetMapping("/one")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam(value = "userId",required = false) Integer userId,@RequestParam(value = "equipmentId",required = false) Integer equipmentId){

        return behaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);

    }

}
